﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Apodidae.IdGenerator
{
    /// <summary>
    /// 用户对象的主键生成策略
    /// </summary>
    public class UserInfoIdGenerator : NHibernate.Id.IIdentifierGenerator
    {
        public object Generate(NHibernate.Engine.ISessionImplementor session, object obj)
        {
            System.Threading.Thread.Sleep(2);
            var sbId = new StringBuilder();
            sbId.Append("US");
            sbId.Append(DateTime.Now.ToString("yyyyMMddHHmmssffff"));

            return sbId.ToString();
        }
    }
}
